package com.example.controller;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {
    @GetMapping("test1")
//    @RequiresRoles("admin")
    @RequiresPermissions("user:add")
    public String test(){
        return "test1";
    }

    @GetMapping("test2")
    @RequiresPermissions("other:copy")
    public String test2(){
        return "test2";
    }

    @GetMapping("test3")
    @RequiresRoles("guest")
    @RequiresPermissions("other:check")
    public String test3(){
        return "test3";
    }
}
